package edu.zut.cs.software.estateagent.message.web.spring.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import edu.zut.cs.software.base.web.spring.controller.GenericController;
import edu.zut.cs.software.estateagent.message.domain.Assess;
import edu.zut.cs.software.estateagent.message.service.AssessManager;

@Controller
@CrossOrigin(origins = "*")
@RequestMapping("/message/assess")
public class AssessController extends GenericController<Assess, Long, AssessManager> {
	AssessManager assessManager;

	@RequestMapping(method = RequestMethod.GET, value = "/index.html")
	public String index() {
		String result = "/assess/index";
		return result;
	}

	@Autowired
	public void setAssessManager(AssessManager assessManager) {
		this.assessManager = assessManager;
		this.manager = this.assessManager;
	}

	@RequestMapping(method = RequestMethod.GET, value = "/listresult")
	@ResponseBody
	public String list() {
		
		
		String back = "{\"code\": 20000,\"data\": {\"total\": 100,\"items\": [{\"id\": 9,\"timestamp\": 1228294650120,\"author\": \"Donna\",\"reviewer\": \"Karen\",\"title\": \"UkbbcqgNcemEuzjtduaqzPkuTjtjgiboAussrvjzTffBddx\",\"content_short\": \"mockdata\",\"content\": \"<p>Iamtestingdata,Iamtestingdata.</p><p><imgsrc=\\\"https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943\\\"></p>\",\"forecast\": 36.42,\"importance\": 1,\"type\": \"US\",\"status\": \"published\",\"display_time\": \"2011-05-1112:23:00\",\"comment_disabled\": true,\"pageviews\": 4186,\"image_uri\": \"https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3\",\"platforms\": [\"a-platform\"]}]}}";
		return back;
	}

}
